Feature: As a customer I want to check when I could have a connection to NBN
  Scenario: Input Armidale in the address field then 5 related addresses should pre-populate
    Given I am on the "nbn homepage"
    When  I enter "Armidale" into "address"
    Then  I should see following pre-populated "addresses"

    |Armidale, New South Wales|
    |Armidale Road, East Tamworth, New South Wales|
    |Armidale Road, Elland, New South Wales       |
    |Armidale Road, Lower Creek, New South Wales  |
    |Armidale, Brown Street, New South Wales      |

    When I click on "Armidale, New South Wales" auto-complete option
    Then I should see "Armidale, New South Wales" in the "address" field

  Scenario: Enter valid address to check NBN availability
    Given I am on the "find a service provider page"
    When  I enter "9 Phoenix Lane Armidale NSW 2350" into "address"
    And   I click on "Find" button
    Then  I should see "Service available" within "callout"

  Scenario: User should be able to visit find RSP page

    Given I visit the "find a service provider page"
    Then I should see "Find a service provider"
    And I should see "Find a satellite service provider"
    And I should see "How to get connected" within "footer promo first tile"
    And I should see "Case Studies" within "footer promo last tile"

  Scenario Outline: User should see a google map when search with location information
    Given I am on the "find a service provider page"
    When I enter "<Search query>" into "address"
    And I click on "Find" button
    And I wait for 10 seconds
    Then I should see "<Formatted Address>" in the "address" field
  Examples:
    | Search query                | Formatted Address                                            |
    | Parliament Dr, Capital Hill | Parliament (Dr or Drive), Capital Hill ACT 2600, Australia   |
    | 10 Watt Street Gosford      | 10 Watt (St or Street), Gosford NSW 2250, Australia          |
    | LOT 217 Rachel Ave          | LOT 217 Rachel (Ave or Avenue), Flinders NSW 2529, Australia |
    | Bicentennial Dr, Golden     | Bicentennial (Dr or Drive), Golden Grove SA 5125, Australia  |

  Scenario: User should be warned for invalid (non australian) location

    Given I am on the "find a service provider page"
    When I enter "New Delhi, Delhi, India" into "address"
    And I click on "Find"
    Then I should see "We are unable to find your address. Please re-enter your address and make sure it is in Australia"
    And I should not see "Show list"
    And I should not see the map
    And I should see "NBN Rollout Map" next to information box
    And I should not see "Find a satellite service provider"
    And I should see "How it works" within "footer promo first tile"
    And I should see "Case Studies" within "footer promo last tile"
